<style lang="less" scoped>
  .f-sy {
    margin-top: 10px;
    margin-left: 10px;
  }
</style>

<template>
  <div>
    <div class="el-collapse-item">
      <div class="el-collapse-item__wrap">
        <el-form class="f-sy" ref="fundMebInfoFeeSetForm" :model="fundMebInfoFeeSetForm">
          <el-form-item label="统计时点" prop="totalTimed">
            <el-select  disabled style="width: 220px" v-model="fundMebInfoFeeSetForm.totalTimed" placeholder="请选择统计时点">
              <el-option
                v-for="item in $store.getters.PARTNER_DIVIDED"
                :key="item.dictVal"
                :label="item.cnDictValname"
                :value="item.dictVal">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="支付状态">
            <template>
              <el-radio-group v-model="fundMebInfoFeeSetForm.hasPaied">
                <el-radio :label="111002001">已支付</el-radio>
                <el-radio :label="111002002">不限</el-radio>
              </el-radio-group>
            </template>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="update">提交</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>
<script>
import {getOne, modify} from '../../api/fund/FundMebInfoFeeSet';

export default {
  data () {
    return {
      fundMebInfoFeeSetForm: {
        id: null,
        totalTimed: '',
        hasPaied: ''
      },
      totalTimedTypes: []
    };
  },
  methods: {
    doGetOne () {
      getOne().then((res) => {
        if (res.data.successFlg) {
          this.fundMebInfoFeeSetForm = res.data.obj;
        };
      }).catch(function (error) {
        this.$message.error('数据加载失败:' + error);
      });
    },
    init () {
      this.doGetOne();
      this.$store.commit('initDict');
    },
    update () {
      this.$refs['fundMebInfoFeeSetForm'].validate((valid) => {
        if (valid) {
          modify(this.fundMebInfoFeeSetForm.id, this.fundMebInfoFeeSetForm).then((res) => {
            if (res.data.successFlg) {
              this.$message.success('更新成功');
              this.fundMebInfoFeeSetForm = res.data.obj;
            }
            ;
          }).catch(function (error) {
            this.$message.error('更新失败:' + error);
          });
        }
      });
    }
  },
  // 初始化数据
  mounted () {
    this.init();
  }
};
</script>
